<%-- 
    Document   : FormTerimaBarang
    Created on : Nov 19, 2013, 5:16:13 PM
    Author     : agung
--%>

<%@page import="Model.Barang"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Form Terima Barang</title>
        <link href="css/screen.css" rel="stylesheet" type="text/css"/>

    </head>
    <body>
         <div id="container"><center> <img src="gambar/handshaking.jpg" width="1350" height="300"></center>
            
                <% session = request.getSession(false);
                    String n = (String) session.getAttribute("uname");
                    if (n != null) {
                        out.print("Anda login sebagai " + n);
                    } else {
                        out.print("Session belum ada");
                    }
                %> 
            <div id="navigation">
                <ul>
                    <li><a href="HomeAdmin.jsp">Home</a></li>
                    <li><a href="FormTerimaBarang.jsp">Terima Barang</a></li>
                    <li><a href="FormLihatBarang.jsp">Lihat Barang</a></li>
                    <li><a href="FormKirimBarang.jsp">Kirim Barang</a></li>
                    <li><a href="FormKonfirmasiPengiriman.jsp">Konfirmasi Pengiriman</a></li>
                    <li><a href="Logout.jsp">Logout</a></li>
                </ul>
            </div>

            <% Barang barang = new Barang();
                String kode = barang.KodePenerimaan();%>

            <div id="content">
                <form id="FTerimaBarang" name="FTerimaBarang" action="TerimaBarangController" onsubmit="return validateForm();"> 
                    <h1>Terima Barang dari Supplier</h1>   
                    <label>Kode Penerimaan </label> : <input name="kodePenerimaan" type="text" id="kodePenerimaan" value="<%=kode%>" disabled=""  size="20" maxlength="20" class="txt" /><br/><br/>
                    <label>Nama Barang </label> : <input name="namaBarang" type="text" id="namaBarang" size="20" maxlength="20" class="txt" /><br/><br/>   
                    <label>Harga </label> : <input name="hargaBarang" type="text" id="hargaBarang" size="10" maxlength="20" class="txt" /><br/><br/>   
                    <label>Jumlah </label> : <input name="jumlahBarang" type="text" id="jumlahBarang" size="10" maxlength="20" class="txt" /><br/><br/>   
                    <div id="tombol">
                        <input name="btnSimpan" type="submit" value="Simpan" class="button" />
                        <input name="btnReset" type="reset" value="Reset" class="button" />
                    </div> 
                </form> 

                <script>
                    function validateForm()
                    {
                        var a = document.forms["FTerimaBarang"]["kodePenerimaan"].value;
                        if (a === null || a === "")
                        {
                            alert("Kode penerimaan masih kosong");
                            return false;
                        }
                        var b = document.forms["FTerimaBarang"]["namaBarang"].value;
                        if (b === null || b === "")
                        {
                            alert("Nama barang masih kosong");
                            return false;
                        }
                        var c = document.forms["FTerimaBarang"]["hargaBarang"].value;
                        if (c === null || c === "")
                        {
                            alert("Harga barang masih kosong");
                            return false;
                        }
                        var c = document.forms["FTerimaBarang"]["jumlahBarang"].value;
                        if (c === null || c === "")
                        {
                            alert("Jumlah barang masih kosong");
                            return false;
                        }

                    }
                </script>

            </div>
            <div id="footer">
                Copyright © Sistem Informasi Distributor Indomaret, 2013
            </div>
        </div>
    </body>
</html>
